package com.zzl.car.service;

import com.zzl.car.entity.zdp;
import com.zzl.car.mapper.zdpMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CachePut;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

@Service
public class ZdpDemoService {
    @Autowired
    private zdpMapper zdpMapper;

    @Cacheable(cacheNames = "zdpDemoCache",key="#root.methodName")
        public zdp getAllZdp(){
        System.out.println("调用数据库");
        return zdpMapper.getzdp();
    }
}
